import { Controller, Get } from '../decorator'

const fnDebugLog = require('debug')('controller::user')

@Controller('users')
export class UserController {
  @Get()
  getAll (params:string) {
    fnDebugLog(`Controller::getAll@(${(this as any).root}) - `, params)
    return [
      { name: 'Tom',    age: '12'},
      { name: 'Jerry',  age: '11'},
    ]
  }

  @Get('vip')
  getVIP (params:string) {
    fnDebugLog(`Controller::getVIP@(${(this as any).root}) - `, params)
    return [
      { name: 'Mike',   age: '72'},
      { name: 'Bob',    age: '68'},
    ]
  }
}

@Controller('teachers')
export class TeacherController {
  @Get()
  getAll (params:string) {
    fnDebugLog(`TeacherController::getAll@(${(this as any).root}) - `, params)
    return [
      { name: 'Fang',  age: '47'},
      { name: 'Yuan',  age: '36'},
    ]
  }
}
